<%@ page contentType="text/html;charset=UTF-8"%>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
<meta name="decorator" content="moduleList" />
<link rel="stylesheet" href="${staticPath}/lib/ztree/3.5/css/zTreeStyle/zTreeStyle.css" type="text/css">
	<script src="${staticPath}/lib/ztree/3.5/js/jquery.ztree.all-3.5.js" type="text/javascript"></script>
	<script src="${staticPath}/js/jquery-dialog.js" type="text/javascript"></script>
 <script type="text/javascript" src="${staticPath}/lib/jquery-autocomplete/1.1/jquery.autocomplete.min.js"></script>
 	<link rel="stylesheet" href="${staticPath}/lib/jquery-autocomplete/1.1/jquery.autocomplete.css" />
<script type="text/javascript">
$(document).ready(function() { 

	//单选对话框
	var shopDialog = {
			service: "selectOneShopService",
			idField: "shopNo",
			nameField: "shopName",
			title: "门店选择对话框"
	};
	$("#shopDialog").Dialog(shopDialog);
	//自动补全
	 var options={
			 width: 200,
			 highlight: false,
			 multiple: false,
			 scroll: true,
			 max:10,
			 scrollHeight: 300
		};
	 $("#brandCname").autocomplete("${contextPath}/biz/brand/brand/autocompleteBrandName?name=cn",options );
	 $("#brandEname").autocomplete("${contextPath}/biz/brand/brand/autocompleteBrandName?name=en",options );
});
$(function() {
	$("#toSap").removeAttr("disabled");
});
function clearShopInfo()
{
	$("#shopNo").val("");
	$("#shopName").val("");
}
</script>
</head>
<body>
<form:form name="listForm" action="" modelAttribute="brandPic" method="post" class="form-inline" role="form">
 	<input type="hidden" name="deleteIds" >
 	<input type="hidden" name="sendIds" >
    	<div class="o-l-search-builder f_1">
    	<div id="statement-search-builder" class="collapse" style="height:auto;">
    		<div class="f_2">
	                 <div class="form-group col-sm-6">
	                      <label for="inputEmail3" class="col-sm-3 control-label f_4">品牌中文名：</label>
	                      <div class="col-sm-9 f_6">
	                       	<form:input id="brandCname" path="brandCname"class="f_5" autocomplete="off"/>
	                      </div>
	                  </div>
	                  <div class="form-group col-sm-6">
	                      <label for="inputEmail3" class="col-sm-3 control-label f_7">品牌英文名：</label>
	                      <div class="col-sm-9 f_6">
	                         <form:input id="brandEname" path="brandEname"class="f_5"/>
	                      </div>
	                  </div>
	             </div>
	             <div class="f_2">
	                <div class="form-group col-sm-6">
						<label for="shopName" class="col-sm-3 control-label f_4">门店:</label>
						<div class="col-sm-9 f_6">
							<div class="input-group">
								<form:hidden path="shopNo"/>
								 <form:input id="shopName" path="shopName"class="f_5" readonly="true"/>
							  	<span class="input-group-btn f_time" onclick="clearShopInfo();"><span class="glyphicon glyphicon-remove"></span></span>
							      <span class="input-group-btn">
							        <button class="btn btn-default btn_3" id="shopDialog" type="button">
							        	选择
							        </button>
							      </span>
							 </div>
					    </div>
	             	</div>
	         </div>
	         </div>
	         <div class="f_8">
	              <div class="f_2">
	                  <div class="col-sm-8 f_6">
	                        <form:input id="brandNo" path="brandNo"class="f_5" placeholder="品牌编号"/>
	                  </div>
	                  <button type="submit" class="btn btn-warning btn_1">查&nbsp;询</button>
	             </div>
	         </div>
	         <div class="o-l-chevron-down"><a href="#" class="btn btn-default" data-toggle="collapse" data-target="#statement-search-builder" id="chevronDownBtn" role="button"><span id="glyphiconspan" class="glyphicon glyphicon-chevron-up"></span></a>
	         </div>
	     </div>
    	<div class="o-l-search-builder f_1">
              <button type="button" class="btn btn-danger btn_3 btn_right" onclick="Oosp_DelAll('${contextPath}/biz/brand/pic/deleteAll','table1')">删&nbsp;除</button>
              <button type="button" id="toSap" class="btn btn-success btn_5 btn_right" onclick="send_IDs('${contextPath}/biz/brand/pic/sapAll','table1')">发送SAP</button>
              <button type="button" class="btn btn-info btn_3 btn_right" onclick="window.open('${contextPath}/biz/brand/pic/add','_self')">新&nbsp;建</button>
        </div>   
		<tags:message content="${message}"/>
		<div class="o-l-search-builder f_9">
		<table class="table table-striped table-hover o-l-table table-bordered" id="table1">
			<thead class="t_1">
				<tr>
					<th style="width: 1px"><input type="checkbox" data-ckb="all"></th>
					<th>门店编码</th>
					<th>门店名</th>
					<th>品牌编码</th>
					<th>品牌名称</th>
					<th>招商分类</th>
					<th>采购责任人工号</th>
					<th>采购责任人</th>
					<th>营运负责人工号</th>
					<th>营运负责人</th>
				</tr>
			</thead>
			<tbody>
				<c:forEach items="${page.list}" var="pic">
					<tr data-herf="${contextPath}/biz/brand/pic/${pic.id}/view" data-target="_self">
						<td class="o-l-tab-ckb">
							<input type="checkbox" data-ckb-id="${pic.id}">
						</td>
						<td>${pic.shopNo}</td>
						<td>${pic.shopName}</td>
						<td>${pic.brandNo}</td>
						<td>${pic.brandCname}</td>
						<td>${pic.cateName}</td>
						<td>${pic.purchasePic}</td>
						<td>${pic.purchasePicName}</td>
						<td>${pic.officerPic}</td>
						<td>${pic.officerPicName}</td>
					</tr>
				</c:forEach>
				
			</tbody>
		</table>
		</div>
	<pager:pager pageSize="${page.pageSize}" pageNo="${page.pageNo}" url="" total="${page.total}"/>
<script type="text/javascript" src="${staticPath}/js/list.js"></script>
<script type="text/javascript" src="${staticPath}/js/brand.js"></script>
</form:form>
</body>
</html>